<?php

class Session {
    
    static public function start() {
        @session_start();        
    }

    static public function set($sChave, $xValor) {
        $_SESSION[$sChave] = $xValor;
    }
    
    static public function get($sChave) {
        if (isset($_SESSION[$sChave])) {
            return $_SESSION[$sChave];
        }
        return null;        
    }
    
    static public function setObject($sChave, $oValor) {
        self::set($sChave, serialize($oValor));
    }    
    
    static public function getObject($sChave) {
        if ($xValor = self::get($sChave)) {
            return unserialize($xValor);
        }
        return null;
    }

    static public function reset() {
        $_SESSION = array();
    } 
    
    static public function debug() {
        var_dump($_SESSION);
    }    
    
}
